package com.bcxj.apipassenger.service;

import com.bcxj.apipassenger.remote.ServiceRoutePlanClient;
import com.bcxj.apipassenger.remote.ServiceUserClient;
import com.bcxj.internalcommon.dto.*;
import com.bcxj.internalcommon.response.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: DirectionService
 * Package: com.bcxj.apipassenger.service
 * Description:
 *
 * @Author BCXJ
 * @Create 2025/3/1 12:04
 * @Version 1.0
 * @Since 1.0
 */
@Service
public class DirectionService {

    @Autowired
    private ServiceRoutePlanClient serviceRoutePlanClient;

    /**
     * 步行
     * @param directionWalkDTO
     * @return
     */
    public ResponseResult walk(DirectionWalkDTO directionWalkDTO) {
        return serviceRoutePlanClient.walk(directionWalkDTO.getDepLongitude(),
                directionWalkDTO.getDepLatitude(),
                directionWalkDTO.getDestLongitude(),
                directionWalkDTO.getDestLatitude());
    }


    /**
     * 驾车
     * @param directionDriveDTO
     * @return
     */
    public ResponseResult drive(DirectionDriveDTO directionDriveDTO) {
        return serviceRoutePlanClient.drivering(directionDriveDTO.getDepLongitude(),
                directionDriveDTO.getDepLatitude(),
                directionDriveDTO.getDestLongitude(),
                directionDriveDTO.getDestLatitude(),
                directionDriveDTO.getStrategy());
    }


    /**
     * 公共交通
     * @param directionTransitDTO
     * @return
     */
    public ResponseResult transit(DirectionTransitDTO directionTransitDTO) {
        return serviceRoutePlanClient.publicTransport(directionTransitDTO.getDepLongitude(),
                directionTransitDTO.getDepLatitude(),
                directionTransitDTO.getDestLongitude(),
                directionTransitDTO.getDestLatitude(),
                directionTransitDTO.getDepCity(),
                directionTransitDTO.getDestCity(),
                directionTransitDTO.getStrategy());
    }


    /**
     * 骑行
     * @param directionBicycleDTO
     * @return
     */
    public ResponseResult bicycle(DirectionBicycleDTO directionBicycleDTO) {
        return serviceRoutePlanClient.bicycle(directionBicycleDTO.getDepLongitude(),
                directionBicycleDTO.getDepLatitude(),
                directionBicycleDTO.getDestLongitude(),
                directionBicycleDTO.getDestLatitude());
    }

    /**
     * 推荐服务
     * @param directionRecommendDTO
     * @return
     */
    public ResponseResult recommend(DirectionRecommendDTO directionRecommendDTO) {
        Long userId = directionRecommendDTO.getUserId();
        String depLongitude = directionRecommendDTO.getDepLongitude();
        String depLatitude = directionRecommendDTO.getDepLatitude();
        String destLongitude = directionRecommendDTO.getDestLongitude();
        String destLatitude = directionRecommendDTO.getDestLatitude();
        return serviceRoutePlanClient.recommend(directionRecommendDTO);
    }
}
